// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router'
import Index from '../components/index.vue'
import Activity from '../components/activity.vue'
import SignIn from '../components/signin.vue'
import User from '../components/user.vue'
import Integral from '../components/Integral.vue'
import Login from '../components/login.vue'
import Register from '../components/register.vue'

const routes = [
  {
    path: '/',
    redirect: '/activity-list'  // 默认进入活动列表页面
  },
  {
    path: '/activity-list',
    name: 'ActivityList',
    component: Index,
    meta: { title: '活动列表' }
  },
  {
    path: '/activity-management',
    name: 'ActivityManagement',
    component: Activity,
    meta: { title: '活动管理' }
  },
  {
    path: '/checkin-management',
    name: 'CheckinManagement',
    component: SignIn,
    meta: { title: '签到管理' }
  },
  {
    path: '/user-management',
    name: 'UserManagement',
    component: User,
    meta: { title: '用户管理' }
  },
  {
    path: '/points-management',
    name: 'PointsManagement',
    component: Integral,
    meta: { title: '积分管理' }
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
    meta: { 
      title: '志愿者管理系统',
      headerButton: false,
      footer: false
    }
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
    meta: { 
      title: '志愿者管理系统',
      headerButton: false,
      footer: false
    }
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router